package top.chukongxiang.project.base.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegxUtils {

    public static final Pattern numberPattern = Pattern.compile("^-?\\d+(\\.\\d+)?$");

    public static boolean isNumber(String... strs){
        for (String str:strs) {
            Matcher matcher = numberPattern.matcher(str);
            if (!matcher.matches()){ return false; }
        }
        return true;
    }

    public static final Pattern videoPattern = Pattern.compile("^(video/)(\\s|\\S)+$");

    public static boolean isVideoContent(String contentType) {
        return contentType!=null && videoPattern.matcher(contentType.trim()).matches();
    }

}
